package xyz.icxl.android.architecture.widget

import android.graphics.Rect
import android.view.View
import androidx.recyclerview.widget.RecyclerView

/**
 * # RecyclerView item 之间的间隔
 * - author：`cxl`
 * - date: `2023/3/24`
 */
class SpaceItemDecoration(
    private val top :Int = 0,
    private val start :Int = 0,
    private val end :Int = 0,
    private val bottom :Int = 0,
):RecyclerView.ItemDecoration() {
    override fun getItemOffsets(
        outRect: Rect,
        view: View,
        parent: RecyclerView,
        state: RecyclerView.State
    ) {
        outRect.top = top
        outRect.left = start
        outRect.right = end
        outRect.bottom = bottom
    }
}